SPA_RESOLVE_INIT = function(transition) {

    var html = '<div class="infoList">\n' +
        '<div class="items">\n' +
        '<label>密码</label><input type="password" class="input-txt" id="oldPassword_t"/>\n' +
        '</div>\n' +
        '<div class="items">\n' +
        '<label>新密码</label><input type="password" class="input-txt" id="password_t"/>\n' +
        '</div>\n' +
        '<div class="items">\n' +
        '<label>确认密码</label><input type="password" class="input-txt" id="checkPassword_t"/>\n' +
        '</div>\n' +
        '<div class="items mt-50">\n' +
        '<label></label>\n' +
        '<a class="submit-btn f-16 c-fff text-center rad-3 float-left" onclick="updata_pwdFun()">修 改</a>\n' +
        '</div>\n' +
        '</div>';

    $(".info-tables").html(html);

    $(".infoUL li").eq(2).addClass("active").siblings("li").removeClass("active");
    $(".info-area .title").html("修改密码");
}

function updata_pwdFun(){

    var oldPassword = $("#oldPassword_t").val();
    var password = $("#password_t").val();
    var checkPassword = $("#checkPassword_t").val();

    if(oldPassword==""){
        $.message("请填写旧密码");
        return ;
    }
    if(password==""){
        $.message("请填写新密码");
        return ;
    }
    if(checkPassword==""){
        $.message("请填写确认密码");
        return ;
    }
    if(checkPassword!=password){
        $.message("密码不一致")
        return;
    }

    $.ajax({
        url: update_password_interface,
        type:'post',
        dataType:'json',
        xhrFields:{
            withCredentials:true
        },
        crossDomain:true,
        data:{
            username:user_name,
            oldPassword:oldPassword,
            password:password,
            checkPassword:checkPassword
        },
        success: function(data) {
            if(data.code==200){
                $.message("修改成功");
                $("#oldPassword_t").val("");
                $("#password_t").val("");
                $("#checkPassword_t").val("");
            }else{
                $.message(data.msg);
            }
        },
        error: function () {
            $.message("链接超时，请刷新...");
        }
    });
}